package com.orphan.audit.controller;

import com.orphan.audit.dao.UserFreezeMapper;
import com.orphan.audit.po.UserFreeze;
import com.orphan.audit.service.MqClientService;
import com.orphan.util.dto.SupplierFreezeDto;
import com.orphan.util.dto.SupplierInfoDto;
import com.orphan.util.dto.UsersFreezeDto;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;


@RestController
public class SupplierInfoController {
    //把审核后的数据放进MQ中返回给供应商系统

    @Autowired
    RabbitTemplate rabbitTemplate;


    @GetMapping("supplierInfo")
    public String addTickets(){
      SupplierInfoDto supplierInfoDto =new SupplierInfoDto();
        rabbitTemplate.convertAndSend("supplierExchange","Register",supplierInfoDto);
        return "ok";
    }
    @GetMapping("supplierInfoReturn")
    public String test(){
        SupplierFreezeDto supplierFreezeDto =new SupplierFreezeDto();
        rabbitTemplate.convertAndSend("supplierExchange","RegisterReturn",supplierFreezeDto);
        return "成功";
    }

    @GetMapping("usersFreeze")
    public String userFreeze(){
        UsersFreezeDto usersFreezeDto = new UsersFreezeDto();
        rabbitTemplate.convertAndSend("supplierExchange","UsersFreezeReturn",usersFreezeDto);
        return "成功";
    }

}
